package cn.bugstack.springframework.beans.factory.support;

import cn.bugstack.springframework.beans.factory.config.SingletonBeanRegistry2;

import java.util.HashMap;
import java.util.Map;

public class DefaultSingletonBeanRegistry2 implements SingletonBeanRegistry2 {

    private Map<String,Object> singletonObjects = new HashMap<>();

    @Override
    public Object getSingleton(String beanName) {
        return singletonObjects.get(beanName);
    }

    public void addSingleton(String beanName,Object single){
        this.singletonObjects.put(beanName,single);
    }


}
